<?php

/**
 * Otpusk form base class.
 *
 * @package    alika
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseOtpuskForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'user_id'     => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
      'created_at'  => new sfWidgetFormDate(),
      'date_start'  => new sfWidgetFormDate(),
      'date_expire' => new sfWidgetFormDate(),
      'pub'         => new sfWidgetFormInput(),
      'days'        => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Otpusk', 'column' => 'id', 'required' => false)),
      'user_id'     => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => false)),
      'created_at'  => new sfValidatorDate(array('required' => false)),
      'date_start'  => new sfValidatorDate(array('required' => false)),
      'date_expire' => new sfValidatorDate(array('required' => false)),
      'pub'         => new sfValidatorInteger(array('required' => false)),
      'days'        => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('otpusk[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Otpusk';
  }


}
